<?php
interface ss_element_sidebarInterface {
	public function __construct($name){}
	public function append(ss_element_sidebarNodeInterface $node){}
}

interface ss_element_sidebarNodeInterface{
	public function render(){}
}

class ss_element_sidebar implements Iterator, ss_element_sidebarInterface{
	private $nodes=array();
	protected $position;
	private $name;
    
    
    /**
     * @return
     * @param object $name
     * @see ss_element_sidebarInterface::__construct()
     */
    public function __construct($name)
    {
        $this->name=$name;
        $this->position = 0;
    }
	
	
	public function append(ss_element_sidebarNodeInterface $node){
		$this->nodes[]=$node;
	}        /**     * Gets $name.     * @see ss_element_sidebar::$name     */    public function getName()    {        return $this->name;    }        /**     * Sets $name.     * @param object $name     * @see ss_element_sidebar::$name     */    public function setName($name)    {        $this->name = $name;    }

    function rewind() {
        $this->position = 0;
    }

    function current() {
        return $this->nodes[$this->position];
    }

    function key() {
        return $this->position;
    }

    function next() {
        ++$this->position;
    }

    function valid() {
        return isset($this->node[$this->position]);
    }            /**     * Gets $nodes.     * @see ss_element_sidebar::$nodes     */    public function getNodes()    {        return $this->nodes;    }    
}

class ss_element_sidebar_separator implements ss_element_sidebarNodeInterface{
	public function render(){
		return "<hr/>";
	}
}

class ss_element_sidebar_link implements ss_element_sidebarNodeInterface{
	protected $content;
	protected $url;
	
	public function __create($content, $url){
		$this->content=$content;
		$this->url=$url;
	}
	
	public function renderHtml(){
		return "<a href=\"{$this->link}\">{$this->content}</a>";
	}
}
?>